import axios from  'axios';

import NProgress from 'nprogress'
import 'nprogress/nprogress.css'

const axiosIns = axios.create({
    baseURL: '/api',
    timeout:10000,
});

axiosIns.interceptors.request.use(function (config) {
    NProgress.start();
    return config;
});

axiosIns.interceptors.response.use(function (response) {
    NProgress.done();
    return response.data;
},function (error) {
    NProgress.done();
    return Promise.reject(error);
});

export default axiosIns;